<%= form_for @changeset, @action, fn f -> %>
  <%= if @changeset.action do %>
    <div class="alert alert-danger">
      <p><%= gettext("Oops, something went wrong! Please check the errors below.") %></p>
    </div>
  <% end %>

  <div class="field">
    <%= label f, :industry_id, gettext("Industry"), class: "field" %>
    <div class="control">
      <span class="select">
        <%= select f, :industry_id, select_industries(@industries) %>
      </span>
    </div>
  </div>

  <div class="field">
    <%= label f, :name, gettext("Name"), class: "field" %>
    <div class="control">
      <%= text_input f, :name, class: "input" %>
      <%= error_tag f, :name %>
    </div>
  </div>

  <div class="field">
    <%= label f, :description, gettext("Description"), class: "field" %>
    <div class="control">
      <%= textarea f, :description, class: "textarea" %>
      <%= error_tag f, :description %>
    </div>
    <div class="markdown">
      <i class="fab fa-markdown"></i> <%= gettext("Styling with Markdown is supported") %>
    </div>
  </div>

  <div class="field">
    <%= label f, :url, gettext("Website"), class: "field" %>
    <div class="control">
      <%= text_input f, :url, class: "input" %>
      <%= error_tag f, :url %>
    </div>
  </div>

  <div class="field">
    <%= label f, :location, gettext("Location"), class: "field" %>
    <div class="control">
      <%= text_input f, :location, class: "input" %>
      <%= error_tag f, :location %>
    </div>
  </div>

  <hr>

  <h5 class="subtitle is-5"><%= gettext("Optional fields") %></h5>

  <div class="field">
    <%= label f, :github, "GitHub", class: "field" %>
    <div class="control">
      <%= text_input f, :github, class: "input" %>
      <%= error_tag f, :github %>
    </div>
  </div>

  <div class="field">
    <%= label f, :blog, gettext("Blog website"), class: "field" %>
    <div class="control">
      <%= text_input f, :blog, class: "input" %>
      <%= error_tag f, :blog %>
    </div>
  </div>

  <div class="field is-grouped is-grouped-centered">
    <div class="control">
      <%= submit gettext("Save"), class: "button is-primary" %>
    </div>
    <div class="control">
      <%= link gettext("Back"), to: Routes.company_path(@conn, :recent, locale(@conn)), class: "button is-primary" %>
    </div>
  </div>
<% end %>
